package com.example.music_mediaplayer.observermodel;

import java.util.Observable;

/**
 * Created by quan on 2018/1/24.
 */

public class MyObservable extends Observable{
    //单例
    private static MyObservable instance = null;

    public static MyObservable getInstance(){
        if (instance == null){
            instance = new MyObservable();
        }
        return instance;
    }

    //通知观察者更新数据
    public void notifyChangeView(int current){
        //关键方法，必须写
        setChanged();
        notifyObservers(current);
    }

}
